﻿<%@ Page Title="" Language="C#" Theme = "DetailsView"MasterPageFile="~/Managers.master" AutoEventWireup="true" CodeFile="MVisitor.aspx.cs" Inherits="MVisitor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:DetailsView 
         ID = "dtlVisitor"
         DataSourceID = "srcVisitor"
         SkinID = "Colorful"
         AutoGenerateInsertButton = "true"
         HeaderText = "访客登记"
         AutoGenerateRows = "false"
         DefaultMode = "Insert"
         AllowPaging = "true"
         runat = "server">
         <Fields>
         <asp:BoundField 
             DataField = "id"
             HeaderText = "编号" />
         <asp:BoundField 
             DataField = "visitname"
             HeaderText = "姓名" />
        <asp:BoundField 
             DataField ="sname"
             HeaderText = "被访者姓名" />           
        <asp:BoundField 
             DataField =  "b_n"
             HeaderText = "楼号" />
        <asp:BoundField 
             DataField =  "d_n"
             HeaderText = "宿舍号" />
        <asp:BoundField 
             DataField = "cometime"
             HeaderText = "到来时间" />
        <asp:BoundField 
             DataField = "leavetime"
             HeaderText = "离开时间" />
        <asp:CheckBoxField 
             DataField = "go"
             HeaderText = "是否离开" 
             ReadOnly = "true"/>  
         </Fields>
     </asp:DetailsView>
     <asp:SqlDataSource 
         ID = "srcVisitor"
         ConnectionString = "<%$ ConnectionStrings:Dormitory %>"
         InsertCommand = "insert  cometovisit(id,sname,visitname,d_n ,cometime,leavetime,b_n )
            values(@id,@sname,@visitname,@d_n ,@cometime,@leavetime,@b_n)"
         runat = "server" ></asp:SqlDataSource>
</asp:Content>

